// Handling of certificates and keypairs for SSLStreamAdapter's peer mode.
#if HAVE_CONFIG_H
#include "config.h"
#endif  // HAVE_CONFIG_H

#include "sslidentity.h"

#include <string>

#include "sslconfig.h"

#if SSL_USE_SCHANNEL

#elif SSL_USE_OPENSSL  // !SSL_USE_SCHANNEL

#include "opensslidentity.h"

#elif SSL_USE_NSS  // !SSL_USE_SCHANNEL && !SSL_USE_OPENSSL

#include "nssidentity.h"

#endif  // SSL_USE_SCHANNEL

namespace base {

#if SSL_USE_SCHANNEL

	SSLCertificate* SSLCertificate::FromPEMString(const std::string& pem_string,
		int* pem_length) {
			return NULL;
	}

	SSLIdentity* SSLIdentity::Generate(const std::string& common_name) {
		return NULL;
	}

#elif SSL_USE_OPENSSL  // !SSL_USE_SCHANNEL

	SSLCertificate* SSLCertificate::FromPEMString(const std::string& pem_string,
		int* pem_length) {
			return OpenSSLCertificate::FromPEMString(pem_string, pem_length);
	}

	SSLIdentity* SSLIdentity::Generate(const std::string& common_name) {
		return OpenSSLIdentity::Generate(common_name);
	}

#elif SSL_USE_NSS  // !SSL_USE_OPENSSL && !SSL_USE_SCHANNEL

	SSLCertificate* SSLCertificate::FromPEMString(const std::string& pem_string,
		int* pem_length) {
			return NSSCertificate::FromPEMString(pem_string, pem_length);
	}

	SSLIdentity* SSLIdentity::Generate(const std::string& common_name) {
		return NSSIdentity::Generate(common_name);
	}

#else  // !SSL_USE_OPENSSL && !SSL_USE_SCHANNEL && !SSL_USE_NSS

#error "No SSL implementation"

#endif  // SSL_USE_SCHANNEL

}  // namespace base
